Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a deprecation warning for 'ENVIRONMENT' & env fallback #277

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

arm4b
Copy link
Member

@arm4b arm4b commented Aug 11, 2022

In v2.0.0 the ENVIRONMENT was dropped and replaced with BITOPS_ENVIRONMENT.

Per discussion in #269 (comment) instead of erroring, we try to guess if the user is still relying on the old var, try to handle it gracefully by injecting the old value into the new BITOPS_ENVIRONMENT, and give a Deprecation Warning.

@arm4b arm4b added the enhancement ✨ New feature or request label Aug 11, 2022
Comment on lines +54 to +58
# TODO: Drop support for 'ENVIRONMENT' env var
if 'ENVIRONMENT' in os.environ:
logger.warning(
"'ENVIRONMENT' var is deprecated in v2.0.0 and will be removed in the future versions! "
"Use the 'BITOPS_ENVIRONMENT' env var instead!"
Copy link
Member Author

@arm4b arm4b Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that ENVIRONMENT is deprecated in v2.0.0 in favor of new BITOPS_ENVIRONMENT, but we're handling the case gracefully by merging the values.

The question though, in which BitOps version do we want to drop the ENVIRONMENT var completely?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd create an issue/discussion so we can discuss (also to add it to the roadmap)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a note here: #245 (comment) in the "Roadmap" Discussion so it's not lost.

@arm4b arm4b merged commit 62374e9 into main Aug 15, 2022
@arm4b arm4b deleted the enh/environment-deprecation-warning branch August 15, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants